﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>加油</title>
    <link href="/CSS/Module/public.css" rel="stylesheet" type="text/css" />
    <link href="/CSS/Module/QC1.css" rel="stylesheet" type="text/css" />

    <script src="/JS/jquery.js" type="text/javascript"></script>

    <script src="/JS/jyAjax.js" type="text/javascript"></script>

    <link href="/JS/MsgBox/moonbox.css" rel="stylesheet" type="text/css" />

    <script src="/JS/MsgBox/moonbox.js" type="text/javascript"></script>

    <script src="/JS/module.js" type="text/javascript"></script>

    <script type="text/javascript" language="javascript">
    function Validate(){    
        var pwd=$("#venuesPwd").val();
        var moduleId=$("#hiddenModuleId").val();        
        if(pwd.length>0){
            PostAjax("/Module/Venues/MyTCenter.ashx","venuesPwd="+pwd+"&ModuleId="+moduleId);
        }else{
            $.moonbox.error('请输入密码！');
        }
    }
    
    function ValidateClub(){
        var count=$("#selCountHidden").val();
        var type=$("#mTypeHidden").val();        
        if(count<1){            
                $.moonbox.warning('请选择至少一个俱乐部然后进行训练！');                        
            return false;
        }        
        return true;
    }
    
    $(function(){
        $("#clubListDiv input[type=checkbox]").click(function(){        
            var count=parseInt($("#selCountHidden").val());
            var idItems=$("#selClubHidden").val();
            var id=this.value;
            if(this.checked){
                count=count+1;
                if(idItems==""){
                    idItems=id;
                }else{
                    idItems=idItems+"_"+id;
                }
            }else{
                count=count-1;
                idItems=idItems.replace("_"+id,"");                
            }
            $("#selCountHidden").val(count);
            $("#selClubHidden").val(idItems);                                
            var chks = $("#clubListDiv input[type=checkbox]");
            var maxCount=$("#maxCountHidden").val();
            if(count>=maxCount){                
              for(var i=0;i<chks.length;i++){                                        
                  if(!chks[i].checked){
                      chks[i].disabled="disabled"; 
                  }else{
                      chks[i].disabled=""; 
                  } 
              }                                      
           }else{
               for(var j=0;j<chks.length;j++){                    
                   chks[j].disabled="";  
               }                   
           }	
            
        })
    })
    
    </script>

    <script type="text/javascript" language="JavaScript" event="FSCommand (command, args)"
        for="CourtSwf">
	    switch(command)
       {
   	    case "flashExport":
		    flashTest(args);
	 	    break;
   	    default:
	 	    break;
       }
    </script>

    <script type="text/javascript" language="javascript">
    function flashTest(val){
        PostAjax("/Module/Venues/SaveAnnexe.ashx","ModuleId="+$("#hiddenModuleId").val()+"&Annexe="+val);
    }
    </script>

</head>
<body>
    $Header$ $MainMenu$
    <div class="Middle">
        $LeftMenu$
        <div class="Content">
            $ContentClub$
            <div class="QC1Play">
                $Object$</div>
            <div class="QC1Player">
                <div class="QC1PlayerLine1">
                    <ul>
                        <li>好友</li>
                        <li>俱乐部名</li>
                        <li>胜率</li>
                        <li>状态</li>
                    </ul>
                    <ul>
                        <li>好友</li>
                        <li>俱乐部名</li>
                        <li>胜率</li>
                        <li>状态</li>
                    </ul>
                </div>
                <div id="clubListDiv" class="QC1PlayerLine2">
                    $ClubList$
                </div>
                <div class="QC1PlayerLine3">
                    <ul class="QC1PlayerLine3Left">
                        <li>
                            <form action="/Module/TCenter/TCenterManage.ashx?Type=Start&VenuesId=$ModuleId$"
                            method="post">
                            <input type="submit" class="BtnBlueBg" value="邀请训练" onclick="if(!ValidateClub()){return false;}" />
                            <input type="hidden" id="selClubHidden" name="selClubHidden" value="$ClubId$" />
                            <input type="hidden" id="selCountHidden" name="selCountHidden" value="$Count$" />
                            <input type="hidden" id="maxCountHidden" name="maxCountHidden" value="$MaxCount$" />
                            <input type="hidden" id="mTypeHidden" name="mTypeHidden" value="$MType$" />
                            </form>
                        </li>
                    </ul>
                    <ul class="QC1PlayerLine3Right">
                        <li class="FontGreenB">
                            <form action="" method="post">
                            <input id="hiddenModuleId" name="hiddenModuleId" type="hidden" value="$ModuleId$" />
                            设置场地密码
                            <input id="venuesPwd" name="venuesPwd" type="password" />
                            <input type="button" value=" " class="SetPsdBtn" onclick="Validate()" />
                            </form>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="TableTop">
                <div class="TableMenu">
                    <ul>
                        <li class="Infobtn"><a onclick="fillhtml('InfoDiv','/Module/Venues/GetState.ashx?Type=State&ModuleId=$ModuleId$'+'&'+ Math.random())">
                            我的动态</a></li>
                        <li><a onclick="fillhtml('InfoDiv','/Module/Venues/GetState.ashx?Type=Training&ModuleId=$ModuleId$'+'&'+ Math.random())">
                            好友训练历史</a></li>
                    </ul>
                </div>
            </div>

            <script type="text/javascript" language="javascript">$(function(){fillhtml('InfoDiv','/Module/Venues/GetState.ashx?Type=State&ModuleId=$ModuleId$'+'&'+ Math.random())})</script>

            <div class="TableMiddle">
                <div id="InfoDiv" class="QC1PlayInfoLine2">
                </div>
            </div>
            <div class="TableBottom">
            </div>
        </div>
    </div>
    $Footer$
</body>
</html>
